import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

import {  GET_TOKEN } from '@/utils/storage.js'

export default new Vuex.Store({
  state: {
    user: GET_TOKEN('USER_TOKEN')||null
  },
  mutations: {
    SET_USER(state, data) {
      window.localStorage.setItem('USER_TOKEN', JSON.stringify(data))
      state.user = data
    }
  },
  actions: {
  },
  modules: {
  }
})
